use rbatis::RBatis;
use rbatis::rbdc::DateTime;
use rbdc_mysql::MysqlDriver;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Game {
    pub id: i64,
    pub name: Option<String>,
    pub name_date: Option<i32>,
    pub alias: Option<String>,
    pub game_type: Option<String>,
    pub image: Option<String>,
    pub comp_lvl_combine: Option<i32>,
    pub comp_lvl_sp: Option<i32>,
    pub comp_lvl_co: Option<i32>,
    pub comp_lvl_mp: Option<i32>,
    pub comp_main: Option<i32>,
    pub comp_plus: Option<i32>,
    pub comp_100: Option<i32>,
    pub comp_all: Option<i32>,
    pub comp_main_count: Option<i32>,
    pub comp_plus_count: Option<i32>,
    pub comp_100_count: Option<i32>,
    pub comp_all_count: Option<i32>,
    pub invested_co: Option<i32>,
    pub invested_mp: Option<i32>,
    pub invested_co_count: Option<i32>,
    pub invested_mp_count: Option<i32>,
    pub count_comp: Option<i32>,
    pub count_speedrun: Option<i32>,
    pub count_backlog: Option<i32>,
    pub count_review: Option<i32>,
    pub review_score: Option<i32>,
    pub count_playing: Option<i32>,
    pub count_retired: Option<i32>,
    pub profile_popular: Option<i32>,
    pub release_world: Option<i32>,
}

impl Default for Game {
    fn default() -> Self {
        Self {
            id: 0,
            name: None,
            name_date: None,
            alias: None,
            game_type: None,
            image: None,
            comp_lvl_combine: None,
            comp_lvl_sp: None,
            comp_lvl_co: None,
            comp_lvl_mp: None,
            comp_main: None,
            comp_plus: None,
            comp_100: None,
            comp_all: None,
            comp_main_count: None,
            comp_plus_count: None,
            comp_100_count: None,
            comp_all_count: None,
            invested_co: None,
            invested_mp: None,
            invested_co_count: None,
            invested_mp_count: None,
            count_comp: None,
            count_speedrun: None,
            count_backlog: None,
            count_review: None,
            review_score: None,
            count_playing: None,
            count_retired: None,
            profile_popular: None,
            release_world: None,
        }
    }
}

//crud = async fn insert(...)+async fn  select_by_column(...)+ async fn  update_by_column(...)+async fn  delete_by_column(...)...and more
rbatis::crud!(Game {});

